<template>
      <div id="app">
          <Header></Header>
          <router-view></router-view>
          <Footer v-show="!this.$route.meta.hideFooter"></Footer>
      </div>
</template>

<script>
import Header from "components/Header"
import Footer from "components/Footer"
import Home from "pages/Home"
import {mapActions} from "vuex";
export default {
  name: 'App',
    components:{
        Header,
        Footer,
        Home,
    },
    methods:{
        ...mapActions(['getList']),
        ...mapActions(['getBanners']),
    },
    created(){
        //触发本组件中的methods中的getList函数
        // getList方法dispatch actions 中对应的方法发送过去数据请求
        // 通过mutations 对应的方法将数据存入 子仓库 home中
        this.getList()
        this.getBanners()
    }

}
</script>

<style scoped>

</style>
